<?php

class RevokeKeyForm extends AbstractForm {
	const NAME = 'revoke';

	public function process() {
		return KeyGenius::revokeUser($this->getValue('code')) ?
			"Yubikey revoked!" : "Invalid revocation code!";
	}

	public function getTitle() {
		return 'Revoke Yubikey';
	}

	public function getDescription() {
		return 'Delete all your stored passwords from this site. This action is irreversible!';
	}

	public function configure() {
		$this->setWidgets(array(
			'code'		=> new sfWidgetFormInput(),
		));

		$this->widgetSchema->setNameFormat(self::NAME.'[%s]');

		$this->setValidators(array(
			'code'		=> new sfValidatorPass(),
		));
	}
}

?>
